package com.github.catvod.spider;

import android.text.TextUtils;
import com.github.catvod.crawler.Spider;
import com.github.catvod.crawler.SpiderDebug;
import com.github.catvod.parser.C0000;
import com.github.catvod.parser.C0001;
import com.github.catvod.parser.C0002;
import com.github.catvod.parser.C0003;
import com.github.catvod.parser.C0004;
import com.github.catvod.parser.C0005;
import com.github.catvod.parser.C0006;
import com.github.catvod.parser.C0007;
import com.github.catvod.parser.C0008;
import com.github.catvod.parser.C0009;
import com.github.catvod.spider.merge.C0011;
import com.github.catvod.spider.merge.C0012;
import com.github.catvod.spider.merge.C0013;
import com.github.catvod.spider.merge.C0014;
import com.github.catvod.spider.merge.C0015;
import com.github.catvod.spider.merge.fP;
import com.github.catvod.spider.merge.lk;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

/* loaded from: classes.dex */
public class Bili extends Spider {

    /* renamed from: short, reason: not valid java name */
    private static final short[] f16short = {2227, 2222, 2211, 1015, 1003, 1003, 1007, 1004, 933, 944, 944, 1022, 1007, 1014, 945, 1021, 1014, 1011, 1014, 1021, 1014, 1011, 1014, 945, 1020, 1008, 1010, 944, 999, 944, 1000, 1018, 1021, 946, 1014, 1009, 1003, 1018, 1005, 1017, 1022, 1020, 1018, 944, 1004, 1018, 1022, 1005, 1020, 1015, 944, 1003, 998, 1007, 1018, 928, 1004, 1018, 1022, 1005, 1020, 1015, 960, 1003, 998, 1007, 1018, 930, 1001, 1014, 1019, 1018, 1008, 953, 1012, 1018, 998, 1000, 1008, 1005, 1019, 930, 2942, 901, 1109, 1027, 1042, 1044, 1046, 1102, 1803, 1806, 1819, 1806, 526, 537, 527, 521, 528, 520, 649, 656, 666, 2076, 2076, 1460, 1448, 1448, 1452, 1455, 1510, 2690, 2715, 2704, 2731, 2717, 2704, 2197, 2177, 2206, 2195, 2711, 2698, 2711, 2703, 2694, 699, 674, 681, 658, 675, 684, 672, 680, 1560, 1537, 1546, 1585, 1566, 1543, 1549, 1966, 1983, 1976, 1963, 1982, 1955, 1957, 1956, 1424, 21347, -27142, 2786, 2811, 2800, 2763, 2790, 2801, 2809, 2805, 2790, 2815, 2791, 2047, 2030, 2024, 2026, 2419, 2402, 2404, 2406, 2400, 2412, 2422, 2413, 2423, 1153, 1156, 1152, 1156, 1177, 1056, 1083, 1056, 1077, 1080, 1384, 1389, 1399, 1392, 2151, 3186, 477, 460, 458, 456, 478, 1367, 1355, 1355, 1359, 1356, 1285, 1296, 1296, 1374, 1359, 1366, 1297, 1373, 1366, 1363, 1366, 1373, 1366, 1363, 1366, 1297, 1372, 1360, 1362, 1296, 1351, 1296, 1352, 1370, 1373, 1298, 1366, 1361, 1355, 1370, 1357, 1369, 1374, 1372, 1370, 1296, 1353, 1366, 1370, 1352, 1280, 1373, 1353, 1366, 1371, 1282, 2556, 2553, 2540, 2553, 1623, 1631, 1618, 2950, 2975, 2964, 2991, 2969, 2964, 1529, 1508, 1529, 1505, 1512, 3106, 3131, 3120, 3083, 3130, 3125, 3129, 3121, 2436, 2461, 2455, 401, 392, 387, 440, 407, 398, 388, 410, 384, 399, 387, 395, 650, 647, 654, 667, 673, 656, 671, 659, 667, 3271, 3294, 3285, 3310, 3272, 3284, 3280, 3267, 2640, 2633, 2626, 2681, 2631, 2644, 2627, 2631, 1539, 1554, 1557, 1542, 1555, 1550, 1544, 1545, 23539, -25238, 2545, 2536, 2531, 2520, 2549, 2530, 2538, 2534, 2549, 2540, 2548, 2018, 2043, 2032, 1995, 2037, 2039, 2016, 2043, 2022, 2177, 2200, 2195, 2216, 2195, 2206, 2181, 2194, 2196, 2179, 2200, 2181, 2509, 2508, 2522, 2506, 2604, 2613, 2622, 2565, 2617, 2613, 2612, 2606, 2623, 2612, 2606, 1128, 1137, 1146, 1089, 1134, 1138, 1151, 1127, 1089, 1144, 1132, 1137, 1139, 3151, 30420, 1376, 1038, 1055, 1036, 1034, 489, 482, 1677, 1671, 1674, 1299, 1290, 1281, 1338, 1301, 1289, 1284, 1308, 1338, 1296, 1303, 1289, 2611, 2614, 2604, 2603, 2269, 2299, 2285, 2298, 2213, 2249, 2287, 2285, 2278, 2300, 2955, 2985, 3004, 2991, 2986, 2986, 2983, 3049, 3059, 3048, 3062, 3046, 3054, 2955, 2983, 2981, 2991, 2984, 2994, 2985, 2997, 2990, 3069, 3046, 2959, 2984, 2994, 2979, 2986, 3046, 2955, 2983, 2981, 3046, 2953, 2965, 3046, 2974, 3046, 3063, 3062, 2969, 3063, 3059, 2969, 3057, 3055, 3046, 2951, 2998, 2998, 2986, 2979, 2961, 2979, 2980, 2957, 2991, 2994, 3049, 3059, 3061, 3057, 3048, 3061, 3056, 3046, 3054, 2957, 2958, 2962, 2955, 2954, 3050, 3046, 2986, 2991, 2989, 2979, 3046, 2945, 2979, 2981, 2989, 2985, 3055, 3046, 2949, 2990, 2996, 2985, 2987, 2979, 3049, 3071, 3063, 3048, 3062, 3048, 3058, 3058, 3057, 3060, 3048, 3063, 3063, 3058, 3046, 2965, 2983, 2976, 2983, 2996, 2991, 3049, 3059, 3061, 3057, 3048, 3061, 3056, 1576, 1546, 1546, 1548, 1561, 1565, 2837, 2820, 2841, 2837, 2894, 2825, 2837, 2828, 2829, 2893, 2816, 2833, 2833, 2829, 2824, 2818, 2816, 2837, 2824, 2830, 2831, 2894, 2841, 2825, 2837, 2828, 2829, 2890, 2841, 2828, 2829, 2893, 2816, 2833, 2833, 2829, 2824, 2818, 2816, 2837, 2824, 2830, 2831, 2894, 2841, 2828, 2829, 2906, 2832, 2908, 2897, 2895, 2904, 2893, 2824, 2828, 2816, 2822, 2820, 2894, 2838, 2820, 2819, 2833, 2893, 2891, 2894, 2891, 2906, 2832, 2908, 2897, 2895, 2905, 3041, 3011, 3011, 3013, 3024, 3028, 2957, 3052, 3009, 3022, 3015, 3029, 3009, 3015, 3013, 2273, 2291, 2230, 2264, 2261, 2231, 2273, 2291, 2208, 2282, 2214, 2219, 2229, 2211, 2231, 2273, 2291, 2230, 2255, 2252, 2208, 2282, 2214, 2219, 2229, 2220, 2231, 2273, 2291, 2230, 2259, 2256, 2208, 2282, 2214, 2219, 2229, 2222, 2231, 2302, 2293, 2230, 2254, 2248, 2208, 2282, 2214, 2219, 2229, 2216, 2231, 2302, 2293, 2208, 2282, 2214, 2219, 2229, 2217, 3044, 3016, 3016, 3020, 3022, 3010, 918, 921, 916, 902, 902, 1313, 1326, 1315, 1329, 1329, 1319, 1329, 1514, 1509, 1504, 1528, 1513, 1534, 1535, 2895, 2880, 2885, 2909, 2892, 2907, 2539, 2551, 2551, 2547, 2544, 2489, 2476, 2476, 2530, 2547, 2538, 2477, 2529, 2538, 2543, 2538, 2529, 2538, 2543, 2538, 2477, 2528, 2540, 2542, 2476, 2555, 2476, 2548, 2534, 2529, 2478, 2538, 2541, 2551, 2534, 2545, 2533, 2530, 2528, 2534, 2476, 2544, 2534, 2530, 2545, 2528, 2539, 2476, 2551, 2554, 2547, 2534, 2492, 2544, 2534, 2530, 2545, 2528, 2539, 2524, 2551, 2554, 2547, 2534, 2494, 2549, 2538, 2535, 2534, 2540, 2469, 2536, 2534, 2554, 2548, 2540, 2545, 2535, 2494, 29460, 2467, 32766, 24553, -24976, 2593, 2596, 2609, 2596, 425, 446, 424, 430, 439, 431, 2571, 2578, 2584, 2838, 2838, 511, 483, 483, 487, 484, 429, 472, 449, 458, 497, 455, 458, 2815, 2795, 2804, 2809, 650, 663, 650, 658, 667, 1253, 1276, 1271, 1228, 1277, 1266, 1278, 1270, 838, 863, 852, 879, 832, 857, 851, 1331, 1314, 1317, 1334, 1315, 1342, 1336, 1337, 1106, 23274, -25485, 1793, 1816, 1811, 1832, 1797, 1810, 1818, 1814, 1797, 1820, 1796, 1741, 1736, 1746, 1749, 271, 264, 278, 1048, 1135, 2393, 2373, 2373, 2369, 2370, 2315, 2334, 2334, 2384, 2369, 2392, 2335, 2387, 2392, 2397, 2392, 2387, 2392, 2397, 2392, 2335, 2386, 2398, 2396, 2334, 2377, 2334, 2369, 2397, 2384, 2376, 2388, 2371, 2334, 2369, 2397, 2384, 2376, 2372, 2371, 2397, 2318, 2384, 2375, 2392, 2389, 2316, 1127, 1058, 1064, 1061, 1148, 1121, 2243, 2196, 2187, 2264, 2260, 2263, 2261, 2243, 2179, 2186, 2192, 2199, 2190, 2264, 2260, 2341, 2356, 2343, 2342, 2352, 494, 2609, 2605, 2592, 2616, 2580, 2611, 2605, 1497, 1500, 1481, 1500, 3030, 3015, 3008, 3038, 2288, 2301, 2297, 2300, 2301, 2282, 531, 586, 570, 525, 526, 525, 538, 525, 538, 586, 594, 
    586, 512, 540, 540, 536, 539, 594, 583, 583, 543, 543, 543, 582, 522, 513, 516, 513, 522, 513, 516, 513, 582, 523, 519, 517, 586, 580, 586, 573, 539, 525, 538, 581, 553, 527, 525, 518, 540, 586, 594, 586, 549, 519, 530, 513, 516, 516, 521, 583, 605, 582, 600, 584, 576, 549, 521, 523, 513, 518, 540, 519, 539, 512, 595, 584, 545, 518, 540, 525, 516, 584, 549, 521, 523, 584, 551, 571, 584, 560, 584, 601, 600, 567, 601, 605, 567, 607, 577, 584, 553, 536, 536, 516, 525, 575, 525, 522, 547, 513, 540, 583, 605, 603, 607, 582, 603, 606, 584, 576, 547, 544, 572, 549, 548, 580, 584, 516, 513, 515, 525, 584, 559, 525, 523, 515, 519, 577, 584, 555, 512, 538, 519, 517, 525, 583, 601, 600, 600, 582, 600, 582, 604, 592, 593, 606, 582, 601, 602, 607, 584, 571, 521, 526, 521, 538, 513, 583, 605, 603, 607, 582, 603, 606, 586, 533, 1784, 1780, 1781, 1775, 1790, 1781, 1775, 1743, 1762, 1771, 1790, 2973, 2946, 2959, 2958, 2948, 3012, 2963, 3014, 2957, 2951, 2973, 2419, 2415, 2415, 2411, 2408, 2337, 2356, 2356, 2426, 2411, 2418, 2357, 2425, 2418, 2423, 2418, 2425, 2418, 2423, 2418, 2357, 2424, 2420, 2422, 2356, 2403, 2356, 2412, 2430, 2425, 2358, 2418, 2421, 2415, 2430, 2409, 2429, 2426, 2424, 2430, 2356, 2408, 2430, 2426, 2409, 2424, 2419, 2356, 2415, 2402, 2411, 2430, 2340, 2408, 2430, 2426, 2409, 2424, 2419, 2372, 2415, 2402, 2411, 2430, 2342, 2413, 2418, 2431, 2430, 2420, 2365, 2416, 2430, 2402, 2412, 2420, 2409, 2431, 2342, 1904, 1909, 1888, 1909, 968, 991, 969, 975, 982, 974, 1254, 1279, 1269, 2286, 2286, 3097, 3077, 3077, 3073, 3074, 3147, 1826, 1851, 1840, 1803, 1853, 1840, 1567, 1547, 1556, 1561, 2230, 2219, 2230, 2222, 2215, 1028, 1053, 1046, 1069, 1052, 1043, 1055, 1047, 1781, 1772, 1767, 1756, 1779, 1770, 1760, 3110, 3127, 3120, 3107, 3126, 3115, 3117, 3116, 1564, 22834, -24661, 547, 570, 561, 522, 551, 560, 568, 564, 551, 574, 550, 1898, 1903, 1909, 1906};
    protected JSONObject h = null;

    public Bili() {
        int m16 = C0005.m16();
        int i = 1616;
        while (true) {
            i ^= 1633;
            switch (i) {
                case 14:
                case 49:
                    i = m16 >= 0 ? 1709 : 1678;
                case 204:
                    System.out.println(Float.valueOf(C0015.m46("cKaUtRDeoXtk7nrowVIB")));
                    break;
                case 239:
                    break;
            }
            return;
        }
    }

    /* JADX WARN: Failed to find 'out' block for switch in B:100:0x01b2. Please report as an issue. */
    /* JADX WARN: Failed to find 'out' block for switch in B:188:0x0150. Please report as an issue. */
    /* JADX WARN: Failed to find 'out' block for switch in B:94:0x00e4. Please report as an issue. */
    public String categoryContent(String str, String str2, boolean z, HashMap<String, String> hashMap) {
        String str3;
        String m43 = C0014.m43(f16short, 0, 3, 2247);
        try {
            String m30 = C0009.m30(f16short, 3, 79, 927);
            int i = 1616;
            while (true) {
                i ^= 1633;
                switch (i) {
                    case 14:
                    case 49:
                        i = hashMap != null ? 1709 : 1678;
                    case 204:
                        int size = hashMap.size();
                        int i2 = 1740;
                        while (true) {
                            i2 ^= 1757;
                            switch (i2) {
                                case 17:
                                    i2 = size > 0 ? 1833 : 1802;
                                case 54:
                                case 471:
                                    break;
                                case 500:
                                    boolean containsKey = hashMap.containsKey(m43);
                                    int i3 = 1864;
                                    while (true) {
                                        i3 ^= 1881;
                                        switch (i3) {
                                            case 17:
                                                i3 = containsKey ? 48736 : 48705;
                                            case 47384:
                                                break;
                                            case 47417:
                                                int length = hashMap.get(m43).length();
                                                int i4 = 48767;
                                                while (true) {
                                                    i4 ^= 48784;
                                                    switch (i4) {
                                                        case 14:
                                                        case 45:
                                                            break;
                                                        case 76:
                                                            str3 = m30 + hashMap.get(m43);
                                                            int i5 = 48891;
                                                            while (true) {
                                                                i5 ^= 48908;
                                                                switch (i5) {
                                                                    case 22:
                                                                        break;
                                                                    case 503:
                                                                        i5 = 48922;
                                                                        continue;
                                                                    default:
                                                                        continue;
                                                                }
                                                            }
                                                            break;
                                                        case 239:
                                                            i4 = length > 0 ? 48860 : 48829;
                                                    }
                                                }
                                                break;
                                            case 47483:
                                        }
                                    }
                                    break;
                            }
                        }
                        break;
                    case 239:
                        break;
                }
            }
            str3 = m30 + str;
            int i6 = 49666;
            while (true) {
                i6 ^= 49683;
                switch (i6) {
                    case 17:
                        i6 = hashMap != null ? 49759 : 49728;
                    case 50:
                    case 76:
                        int size2 = hashMap.size();
                        int i7 = 49790;
                        while (true) {
                            i7 ^= 49807;
                            switch (i7) {
                                case 18:
                                case 51:
                                    break;
                                case 84:
                                    Iterator<String> it = hashMap.keySet().iterator();
                                    String str4 = str3;
                                    while (true) {
                                        boolean hasNext = it.hasNext();
                                        int i8 = 49914;
                                        while (true) {
                                            i8 ^= 49931;
                                            switch (i8) {
                                                case 497:
                                                    i8 = hasNext ? 50658 : 50627;
                                                case 1711:
                                                case 1736:
                                                    break;
                                                case 1769:
                                                    String next = it.next();
                                                    String str5 = hashMap.get(next);
                                                    int length2 = str5.length();
                                                    int i9 = 50689;
                                                    while (true) {
                                                        i9 ^= 50706;
                                                        switch (i9) {
                                                            case 19:
                                                                i9 = length2 > 0 ? 50782 : 50751;
                                                            case 45:
                                                                break;
                                                            case 50:
                                                            case 76:
                                                                str4 = str4 + C0011.m35(f16short, 82, 1, 2904) + next + C0002.m6(f16short, 83, 1, 952) + URLEncoder.encode(str5);
                                                                int i10 = 50813;
                                                                while (true) {
                                                                    i10 ^= 50830;
                                                                    switch (i10) {
                                                                        case 18:
                                                                            break;
                                                                        case 243:
                                                                            i10 = 50844;
                                                                    }
                                                                }
                                                                break;
                                                        }
                                                    }
                                                    break;
                                            }
                                            str3 = str4;
                                            break;
                                        }
                                    }
                                    break;
                                case 241:
                                    i7 = size2 > 0 ? 49883 : 49852;
                            }
                        }
                        break;
                    case 83:
                        break;
                }
            }
            String str6 = str3 + C0009.m30(f16short, 84, 6, 1139) + str2;
            JSONObject jSONObject = new JSONObject(fP.oq(str6, h(str6))).getJSONObject(C0008.m27(f16short, 90, 4, 1903));
            JSONArray jSONArray = new JSONArray();
            JSONArray jSONArray2 = jSONObject.getJSONArray(C0001.m3(f16short, 94, 6, 636));
            int i11 = 0;
            while (true) {
                int length3 = jSONArray2.length();
                int i12 = 51588;
                while (true) {
                    i12 ^= 51605;
                    switch (i12) {
                        case 17:
                            i12 = i11 < length3 ? 51681 : 51650;
                        case 54:
                        case 87:
                            break;
                        case 116:
                            JSONObject jSONObject2 = jSONArray2.getJSONObject(i11);
                            JSONObject jSONObject3 = new JSONObject();
                            String string = jSONObject2.getString(C0013.m41(f16short, 100, 3, 761));
                            boolean startsWith = string.startsWith(C0015.m47(f16short, 103, 2, 2099));
                            int i13 = 51712;
                            while (true) {
                                i13 ^= 51729;
                                switch (i13) {
                                    case 14:
                                    case 17:
                                        i13 = startsWith ? 51805 : 51774;
                                    case 47:
                                        break;
                                    case 76:
                                        string = C0017.m52(f16short, 105, 6, 1500) + string;
                                        break;
                                }
                            }
                            jSONObject3.put(C0007.m26(f16short, 111, 6, 2804), jSONObject2.getString(C0007.m26(f16short, 117, 4, 2295)));
                            jSONObject3.put(C0008.m27(f16short, 126, 8, 717), lk.h(jSONObject2.getString(C0013.m41(f16short, 121, 5, 2787))).e());
                            jSONObject3.put(C0007.m26(f16short, 134, 7, 1646), string);
                            jSONObject3.put(C0003.m9(f16short, 152, 11, 2708), jSONObject2.getString(C0005.m17(f16short, 141, 8, 1994)).split(C0017.m52(f16short, 149, 1, 1450))[0] + C0007.m26(f16short, 150, 2, 357));
                            jSONArray.put(jSONObject3);
                            int i14 = i11 + 1;
                            int i15 = 51836;
                            while (true) {
                                i15 ^= 51853;
                                switch (i15) {
                                    case 241:
                                        i15 = 52518;
                                        break;
                                    case 1963:
                                        break;
                                }
                            }
                            i11 = i14;
                            break;
                    }
                    JSONObject jSONObject4 = new JSONObject();
                    int parseInt = Integer.parseInt(str2);
                    jSONObject4.put(C0003.m9(f16short, 163, 4, 1935), parseInt);
                    int length4 = jSONArray.length();
                    int i16 = 52611;
                    while (true) {
                        i16 ^= 52628;
                        switch (i16) {
                            case 23:
                                if (length4 != 20) {
                                    break;
                                } else {
                                    i16 = 52704;
                                }
                            case 54:
                                break;
                            case 85:
                                break;
                            case 116:
                                parseInt++;
                                break;
                            default:
                                continue;
                        }
                        i16 = 52673;
                    }
                    jSONObject4.put(C0005.m17(f16short, 167, 9, 2307), parseInt);
                    jSONObject4.put(C0001.m3(f16short, 176, 5, 1261), 20);
                    jSONObject4.put(C0011.m35(f16short, 181, 5, 1108), Integer.MAX_VALUE);
                    jSONObject4.put(C0015.m47(f16short, 186, 4, 1284), jSONArray);
                    return jSONObject4.toString();
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    /* JADX WARN: Failed to find 'out' block for switch in B:7:0x01db. Please report as an issue. */
    public String detailContent(List<String> list) {
        int i = 0;
        String m27 = C0008.m27(f16short, 190, 1, 2104);
        String m3 = C0001.m3(f16short, 191, 1, 3158);
        String m9 = C0003.m9(f16short, 192, 5, 429);
        try {
            Init.getPackage();
            String str = list.get(0);
            String str2 = C0005.m17(f16short, 197, 51, 1343) + str;
            JSONObject jSONObject = new JSONObject(fP.oq(str2, h(str2))).getJSONObject(C0002.m6(f16short, 248, 4, 2456));
            String str3 = jSONObject.getLong(C0005.m17(f16short, 252, 3, 1590)) + "";
            JSONObject jSONObject2 = new JSONObject();
            jSONObject2.put(C0013.m41(f16short, 255, 6, 3056), str);
            jSONObject2.put(C0012.m37(f16short, 266, 8, 3156), jSONObject.getString(C0004.m12(f16short, 261, 5, 1421)));
            jSONObject2.put(C0018.m56(f16short, 277, 7, 487), jSONObject.getString(C0003.m9(f16short, 274, 3, 2548)));
            jSONObject2.put(C0015.m47(f16short, 289, 9, 766), jSONObject.getString(C0004.m12(f16short, 284, 5, 494)));
            jSONObject2.put(C0000.m1(f16short, 298, 8, 3249), "");
            jSONObject2.put(C0013.m41(f16short, 306, 8, 2598), "");
            jSONObject2.put(C0006.m18(f16short, 324, 11, 2439), (jSONObject.getJSONArray(m9).getJSONObject(0).getLong(C0006.m18(f16short, 314, 8, 1639)) / 60) + C0014.m43(f16short, 322, 2, 2549));
            jSONObject2.put(C0013.m41(f16short, 335, 9, 1940), "");
            jSONObject2.put(C0002.m6(f16short, 344, 12, 2295), "");
            String string = jSONObject.getString(C0001.m3(f16short, 356, 4, 2473));
            jSONObject2.put(C0007.m26(f16short, 360, 11, 2650), "" + string);
            jSONObject2.put(C0001.m3(f16short, 371, 13, 1054), C0017.m52(f16short, 384, 2, 3085));
            ArrayList arrayList = new ArrayList();
            JSONArray jSONArray = jSONObject.getJSONArray(m9);
            while (true) {
                int length = jSONArray.length();
                String m32 = C0001.m3(f16short, 386, 1, 1347);
                int i2 = 1616;
                while (true) {
                    i2 ^= 1633;
                    switch (i2) {
                        case 14:
                        case 49:
                            i2 = i < length ? 1709 : 1678;
                        case 204:
                            JSONObject jSONObject3 = jSONArray.getJSONObject(i);
                            arrayList.add(jSONObject3.getString(C0014.m43(f16short, 387, 4, 1150)).replace(m3, m27).replace(m32, m27) + m3 + str3 + C0011.m35(f16short, 391, 2, 450) + jSONObject3.getLong(C0011.m35(f16short, 393, 3, 1774)));
                            int i3 = i + 1;
                            int i4 = 1740;
                            while (true) {
                                i4 ^= 1757;
                                switch (i4) {
                                    case 17:
                                        i4 = 1771;
                                        break;
                                    case 54:
                                        break;
                                }
                            }
                            i = i3;
                            break;
                        case 239:
                            break;
                    }
                    jSONObject2.put(C0004.m12(f16short, 396, 12, 1381), TextUtils.join(m32, arrayList));
                    JSONArray jSONArray2 = new JSONArray();
                    jSONArray2.put(jSONObject2);
                    JSONObject jSONObject4 = new JSONObject();
                    jSONObject4.put(C0013.m41(f16short, 408, 4, 2655), jSONArray2);
                    return jSONObject4.toString();
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:60:0x00af, code lost:
    
        return r3;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    protected java.util.HashMap<java.lang.String, java.lang.String> h(java.lang.String r8) {
        /*
            r7 = this;
            r6 = 6
            r0 = 0
            java.lang.String r1 = "ۨ۟ۡ"
            r2 = r0
            r3 = r0
            r4 = r1
            r1 = r0
        L8:
            int r4 = com.github.catvod.parser.C0006.m20(r4)
            switch(r4) {
                case 56474: goto L77;
                case 56507: goto L7c;
                case 56509: goto L8d;
                case 56537: goto L6b;
                case 1746724: goto La1;
                case 1746875: goto L17;
                case 1747750: goto L87;
                case 1748616: goto L3c;
                case 1750722: goto L61;
                case 1750781: goto L22;
                case 1751524: goto Laf;
                case 1751678: goto L1d;
                case 1752461: goto L54;
                case 1753454: goto L47;
                case 1753699: goto L71;
                case 1755338: goto L34;
                case 1755344: goto L2f;
                case 1755367: goto L9b;
                case 1755618: goto L66;
                default: goto Lf;
            }
        Lf:
            java.lang.String r4 = "buvid3=05D72C76-38C1-4F69-AC93-B90C56C0907D110236infoc; LIVE_BUVID=AUTO2015623146874484; sid=53khd8hr; CURRENT_FNVAL=16; stardustvideo=1; rpdid=|(u)~J|uYYRJ0J'ulYJ|~Jul~; _uuid=2A50132F-BFC3-E691-823F-99041AAD3E4B52177infoc; im_notify_type_385625993=0; UM_distinctid=16e12522eb7797-0b291c8a138e46-5373e62-144000-16e12522eb855f; laboratory=1-1; DedeUserID=385625993; DedeUserID__ckMd5=8fb7192f0bcda3a1; SESSDATA=7b969aa2%2C1584488173%2Cf651ce21; bili_jct=65262388cd0ecce875f0530143e0ebb7; CURRENT_QUALITY=32; bp_t_offset_385625993=363207981016294510; INTVER=1"
            r3.put(r1, r4)
            java.lang.String r4 = "ۤ۠۠"
            goto L8
        L17:
            r3.put(r1, r0)
            java.lang.String r4 = "ۨ۟ۧ"
            goto L8
        L1d:
            short[] r2 = com.github.catvod.spider.Bili.f16short
            java.lang.String r4 = "۟۠ۥ"
            goto L8
        L22:
            r1 = 412(0x19c, float:5.77E-43)
            r4 = 10
            r5 = 2184(0x888, float:3.06E-42)
            java.lang.String r1 = com.github.catvod.parser.C0005.m17(r2, r1, r4, r5)
            java.lang.String r4 = "ۥ۟"
            goto L8
        L2f:
            short[] r2 = com.github.catvod.spider.Bili.f16short
            java.lang.String r4 = "ۡ۟ۦ"
            goto L8
        L34:
            java.util.HashMap r3 = new java.util.HashMap
            r3.<init>()
            java.lang.String r4 = "ۣۥۤ"
            goto L8
        L3c:
            r1 = 543(0x21f, float:7.61E-43)
            r4 = 1641(0x669, float:2.3E-42)
            java.lang.String r1 = com.github.catvod.parser.C0000.m1(r2, r1, r6, r4)
            java.lang.String r4 = "۠ۢۨ"
            goto L8
        L47:
            r0 = 422(0x1a6, float:5.91E-43)
            r4 = 121(0x79, float:1.7E-43)
            r5 = 3014(0xbc6, float:4.224E-42)
            java.lang.String r0 = com.github.catvod.parser.C0002.m6(r2, r0, r4, r5)
            java.lang.String r4 = "۟ۥۡ"
            goto L8
        L54:
            r0 = 638(0x27e, float:8.94E-43)
            r4 = 59
            r5 = 2203(0x89b, float:3.087E-42)
            java.lang.String r0 = com.github.catvod.parser.C0005.m17(r2, r0, r4, r5)
            java.lang.String r4 = "ۦۨۥ"
            goto L8
        L61:
            short[] r2 = com.github.catvod.spider.Bili.f16short
            java.lang.String r4 = "ۣۧۡ"
            goto L8
        L66:
            short[] r2 = com.github.catvod.spider.Bili.f16short
            java.lang.String r4 = "ۦۡ"
            goto L8
        L6b:
            r3.put(r1, r0)
            java.lang.String r4 = "ۤۥ۟"
            goto L8
        L71:
            r3.put(r1, r0)
            java.lang.String r4 = "ۨۨۢ"
            goto L8
        L77:
            short[] r2 = com.github.catvod.spider.Bili.f16short
            java.lang.String r4 = "ۦ۠ۨ"
            goto L8
        L7c:
            r1 = 697(0x2b9, float:9.77E-43)
            r4 = 2983(0xba7, float:4.18E-42)
            java.lang.String r1 = com.github.catvod.parser.C0005.m17(r2, r1, r6, r4)
            java.lang.String r4 = "۟ۤ۟"
            goto L8
        L87:
            short[] r2 = com.github.catvod.spider.Bili.f16short
            java.lang.String r4 = "ۦۣ"
            goto L8
        L8d:
            r0 = 549(0x225, float:7.7E-43)
            r4 = 74
            r5 = 2913(0xb61, float:4.082E-42)
            java.lang.String r0 = com.github.catvod.parser.C0006.m18(r2, r0, r4, r5)
            java.lang.String r4 = "ۧ۠"
            goto L8
        L9b:
            short[] r2 = com.github.catvod.spider.Bili.f16short
            java.lang.String r4 = "ۥ۟ۧ"
            goto L8
        La1:
            r1 = 623(0x26f, float:8.73E-43)
            r4 = 15
            r5 = 2976(0xba0, float:4.17E-42)
            java.lang.String r1 = com.github.catvod.parser.C0007.m26(r2, r1, r4, r5)
            java.lang.String r4 = "ۨ۠۟"
            goto L8
        Laf:
            return r3
        */
        throw new UnsupportedOperationException("Method not decompiled: com.github.catvod.spider.Bili.h(java.lang.String):java.util.HashMap");
    }

    public String homeContent(boolean z) {
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put(C0014.m43(f16short, 703, 5, 1013), this.h.getJSONArray(C0001.m3(f16short, 708, 7, 1346)));
            int i = 1616;
            while (true) {
                i ^= 1633;
                switch (i) {
                    case 14:
                        break;
                    case 49:
                        if (!z) {
                            break;
                        } else {
                            i = 1709;
                        }
                    case 204:
                        jSONObject.put(C0004.m12(f16short, 715, 7, 1420), this.h.getJSONObject(C0006.m18(f16short, 722, 6, 2857)));
                        int i2 = 1740;
                        while (true) {
                            i2 ^= 1757;
                            switch (i2) {
                                case 17:
                                    i2 = 1771;
                                    break;
                                case 54:
                                    break;
                            }
                        }
                        break;
                    case 239:
                        break;
                    default:
                        continue;
                }
                i = 1678;
            }
        } catch (JSONException e) {
            SpiderDebug.log(e);
        }
        return jSONObject.toString();
    }

    /* JADX WARN: Failed to find 'out' block for switch in B:8:0x0046. Please report as an issue. */
    public String homeVideoContent() {
        JSONArray jSONArray;
        int i = 0;
        try {
            JSONArray jSONArray2 = new JSONArray();
            try {
                String m17 = C0005.m17(f16short, 728, 84, 2435);
                jSONArray = new JSONObject(fP.oq(m17, h(m17))).getJSONObject(C0011.m35(f16short, 812, 4, 2629)).getJSONArray(C0000.m1(f16short, 816, 6, 475));
            } catch (Exception e) {
                int i2 = 48767;
                while (true) {
                    i2 ^= 48784;
                    switch (i2) {
                        case 14:
                            break;
                        case 239:
                            i2 = 48798;
                            break;
                    }
                }
            }
            while (true) {
                int i3 = i;
                int length = jSONArray.length();
                int i4 = 1616;
                while (true) {
                    i4 ^= 1633;
                    switch (i4) {
                        case 14:
                        case 49:
                            i4 = i3 < length ? 1709 : 1678;
                        case 204:
                            JSONObject jSONObject = jSONArray.getJSONObject(i3);
                            JSONObject jSONObject2 = new JSONObject();
                            String string = jSONObject.getString(C0017.m52(f16short, 822, 3, 2683));
                            boolean startsWith = string.startsWith(C0007.m26(f16short, 825, 2, 2873));
                            int i5 = 1740;
                            while (true) {
                                i5 ^= 1757;
                                switch (i5) {
                                    case 17:
                                        i5 = startsWith ? 1833 : 1802;
                                    case 54:
                                    case 471:
                                        break;
                                    case 500:
                                        string = C0004.m12(f16short, 827, 6, 407) + string;
                                        break;
                                }
                            }
                            jSONObject2.put(C0018.m56(f16short, 833, 6, 430), jSONObject.getString(C0012.m37(f16short, 839, 4, 2717)));
                            jSONObject2.put(C0001.m3(f16short, 848, 8, 1171), lk.h(jSONObject.getString(C0003.m9(f16short, 843, 5, 766))).e());
                            jSONObject2.put(C0001.m3(f16short, 856, 7, 816), string);
                            jSONObject2.put(C0018.m56(f16short, 874, 11, 1911), jSONObject.getString(C0006.m18(f16short, 863, 8, 1367)).split(C0012.m37(f16short, 871, 1, 1128))[0] + C0014.m43(f16short, 872, 2, 2284));
                            jSONArray2.put(jSONObject2);
                            i = i3 + 1;
                            int i6 = 1864;
                            while (true) {
                                i6 ^= 1881;
                                switch (i6) {
                                    case 17:
                                        i6 = 48674;
                                        break;
                                    case 47483:
                                        break;
                                }
                            }
                            break;
                        case 239:
                            break;
                    }
                }
                JSONObject jSONObject3 = new JSONObject();
                jSONObject3.put(C0004.m12(f16short, 885, 4, 1697), jSONArray2);
                return jSONObject3.toString();
            }
        } catch (Throwable th) {
            return "";
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:8:?, code lost:
    
        return;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public void init(android.content.Context r4, java.lang.String r5) {
        /*
            r3 = this;
            super.init(r4, r5)
            java.lang.String r0 = new java.lang.String     // Catch: org.json.JSONException -> L2a
            r1 = 1
            java.lang.String r1 = r5.substring(r1)     // Catch: org.json.JSONException -> L2a
            r2 = 0
            byte[] r1 = android.util.Base64.decode(r1, r2)     // Catch: org.json.JSONException -> L2a
            r0.<init>(r1)     // Catch: org.json.JSONException -> L2a
            r1 = 0
            java.lang.String r0 = com.github.catvod.spider.merge.fP.oq(r0, r1)     // Catch: org.json.JSONException -> L2a
            org.json.JSONObject r1 = new org.json.JSONObject     // Catch: org.json.JSONException -> L2a
            r1.<init>(r0)     // Catch: org.json.JSONException -> L2a
            r3.h = r1     // Catch: org.json.JSONException -> L2a
            r0 = 1616(0x650, float:2.264E-42)
        L20:
            r0 = r0 ^ 1633(0x661, float:2.288E-42)
            switch(r0) {
                case 14: goto L26;
                case 49: goto L27;
                default: goto L25;
            }
        L25:
            goto L20
        L26:
            return
        L27:
            r0 = 1647(0x66f, float:2.308E-42)
            goto L20
        L2a:
            r0 = move-exception
            r0.printStackTrace()
            goto L26
        */
        throw new UnsupportedOperationException("Method not decompiled: com.github.catvod.spider.Bili.init(android.content.Context, java.lang.String):void");
    }

    public String playerContent(String str, String str2, List<String> list) {
        String m18 = C0006.m18(f16short, 889, 3, 378);
        try {
            String[] split = str2.split(C0001.m3(f16short, 892, 2, 1092));
            String str3 = C0013.m41(f16short, 894, 47, 2353) + split[0] + C0002.m6(f16short, 941, 6, 1089) + split[1] + C0005.m17(f16short, 947, 15, 2277);
            JSONObject jSONObject = new JSONObject(fP.oq(str3, h(str3)));
            JSONObject jSONObject2 = new JSONObject();
            jSONObject2.put(C0009.m30(f16short, 962, 5, 2389), C0012.m37(f16short, 967, 1, 478));
            jSONObject2.put(C0002.m6(f16short, 968, 7, 2625), "");
            jSONObject2.put(m18, jSONObject.getJSONObject(C0005.m17(f16short, 975, 4, 1469)).getJSONArray(C0017.m52(f16short, 979, 4, 2994)).getJSONObject(0).getString(m18));
            jSONObject2.put(C0009.m30(f16short, 983, 6, 2200), C0015.m47(f16short, 989, 176, 616));
            jSONObject2.put(C0011.m35(f16short, 1165, 11, 1691), C0012.m37(f16short, 1176, 11, 3051));
            return jSONObject2.toString();
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    /* JADX WARN: Failed to find 'out' block for switch in B:6:0x005e. Please report as an issue. */
    public String searchContent(String str, boolean z) {
        try {
            JSONObject jSONObject = new JSONObject();
            String str2 = C0015.m47(f16short, 1187, 79, 2331) + URLEncoder.encode(str);
            JSONObject jSONObject2 = new JSONObject(fP.oq(str2, h(str2))).getJSONObject(C0014.m43(f16short, 1266, 4, 1812));
            JSONArray jSONArray = new JSONArray();
            JSONArray jSONArray2 = jSONObject2.getJSONArray(C0000.m1(f16short, 1270, 6, 954));
            int i = 0;
            while (true) {
                int length = jSONArray2.length();
                int i2 = 1616;
                while (true) {
                    i2 ^= 1633;
                    switch (i2) {
                        case 14:
                        case 49:
                            i2 = i < length ? 1709 : 1678;
                        case 204:
                            JSONObject jSONObject3 = jSONArray2.getJSONObject(i);
                            JSONObject jSONObject4 = new JSONObject();
                            String string = jSONObject3.getString(C0005.m17(f16short, 1276, 3, 1174));
                            boolean startsWith = string.startsWith(C0008.m27(f16short, 1279, 2, 2241));
                            int i3 = 1740;
                            while (true) {
                                i3 ^= 1757;
                                switch (i3) {
                                    case 17:
                                        i3 = startsWith ? 1833 : 1802;
                                    case 54:
                                    case 471:
                                        break;
                                    case 500:
                                        string = C0003.m9(f16short, 1281, 6, 3185) + string;
                                        break;
                                }
                            }
                            jSONObject4.put(C0014.m43(f16short, 1287, 6, 1876), jSONObject3.getString(C0015.m47(f16short, 1293, 4, 1661)));
                            jSONObject4.put(C0018.m56(f16short, 1302, 8, 1138), lk.h(jSONObject3.getString(C0006.m18(f16short, 1297, 5, 2242))).e());
                            jSONObject4.put(C0007.m26(f16short, 1310, 7, 1667), string);
                            jSONObject4.put(C0008.m27(f16short, 1328, 11, 597), jSONObject3.getString(C0006.m18(f16short, 1317, 8, 3138)).split(C0011.m35(f16short, 1325, 1, 1574))[0] + C0008.m27(f16short, 1326, 2, 2868));
                            jSONArray.put(jSONObject4);
                            int i4 = i + 1;
                            int i5 = 1864;
                            while (true) {
                                i5 ^= 1881;
                                switch (i5) {
                                    case 17:
                                        i5 = 48674;
                                        break;
                                    case 47483:
                                        break;
                                }
                            }
                            i = i4;
                            break;
                        case 239:
                            break;
                    }
                    jSONObject.put(C0018.m56(f16short, 1339, 4, 1798), jSONArray);
                    return jSONObject.toString();
                }
            }
        } catch (Exception e) {
            SpiderDebug.log(e);
            return "";
        }
    }
}
